#ifndef MODEL3DCOMPONENT_H_
#define MODEL3DCOMPONENT_H_

#include <string>


#include "LibraryFrameworkExport.h"
#include "Game/GameTime.h"
#include <iosfwd>
#include "Entities/Component.h"
#include <string>
#include "Sprite/SpriteRenderer.h"
#include "Graphics/Color.h"
#include "Sprite/SpriteTypes.h"
#include "Transform2DComponent.h"
#include "TransformComponent.h"
#include "Graphics/Model/Model.h"
#include "Game/ModelRendererGameComponent.h"
#include "Graphics/Effects/IEffect.h"

namespace CasaEngine
{
	/*
	 *	
	 */
	class LIBRARY_FRAMEWORK_EXPORT Model3DComponent :
		public Component
	{
	public:
		Model3DComponent(BaseEntity* pEntity_);
		virtual ~Model3DComponent();

		//all entities must implement an Initialize function
		void Initialize();

		//all entities must implement an update function
		void  Update(const GameTime& gameTime_);

		//all entities can communicate using messages. They are sent
		//using the MessageDispatcher singleton class
		//void HandleEvent(const Event* pEvent_);
		
		Model *GetModel() const;
		void SetModel(Model *val);

		IEffect *GetEffect() const;
		void SetEffect(IEffect *val);

		//entities should be able to read/write their data to a stream
		void Write(std::ostream&  os)const;
		void Read (std::ifstream& is);

	private:
		TransformComponent* m_pTransform;
		Model *m_pModel;
		IEffect *m_pEffect;
		ModelRendererGameComponent *m_pModelRenderer;
	};

}

#endif // MODEL3DCOMPONENT_H_


